<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="mainlayout.xhtml">
            <ui:define name="content">
                <p:panel>
                    <f:facet name="header">
                        <h:panelGroup style="display: block; text-align:center">
                            <h:outputText value="This is #{usersView.user.name}'s calendar"/>
                        </h:panelGroup>
                    </f:facet>
                    <p:panel>
                        <div align="center">
                            <h:form>
                                <p:growl id="messages" showDetail="true" />

                                <h:panelGrid columnClasses="value">
                                    <p:schedule id="schedule" value="#{otherCalendarView.eventModel}" widgetVar="myschedule" timeZone="GMT+1">


                                        <p:ajax event="eventSelect" listener="#{otherCalendarView.onEventSelect}" update="eventDetails, eventDialog" oncomplete="PF('eventDialog').show();" />

                                    </p:schedule>


                                </h:panelGrid>

                                <p:dialog id="eventDialog" widgetVar="eventDialog" header="#{otherCalendarView.event.title}" showEffect="clip" hideEffect="clip">
                                    <h:panelGrid id="eventDetails" columns="2">

                                        <h:outputLabel for="from" value="From:" />
                                        <h:outputText id="from" value="#{otherCalendarView.event.startDate}">
                                            <f:convertDateTime pattern="dd/MM/yyyy HH:mm" timeZone="GMT+1"/>
                                        </h:outputText>

                                        <h:outputLabel for="to" value="To:" />
                                        <h:outputText id="to" value="#{otherCalendarView.event.endDate}">
                                            <f:convertDateTime pattern="dd/MM/yyyy HH:mm" timeZone="GMT+1" />
                                        </h:outputText>
                                        <p:commandButton id="viewButton" value="View Event" action="#{otherCalendarView.loadEventPage}" disabled="#{!otherCalendarView.event.isPublic}"/>

                                    </h:panelGrid>
                                </p:dialog>

                            </h:form>
                        </div>
                    </p:panel>
                </p:panel>
                <style type="text/css">
                    .value {
                        width: 1000px;
                    }
                </style>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

